
def find(search_list, value):
    search_list = list(sorted(search_list))
    if value not in search_list:
        raise ValueError("value not in array")
    mid_index = (len(search_list) + 1) // 2 - 1
    if (search_list[mid_index] == value):
        return mid_index
    elif search_list[mid_index] < value:
        return find(search_list[mid_index+1:], value) + mid_index + 1
    else:
        return find(search_list[:mid_index], value)
    